/** Unit test program to test the EventProcessor and Messaging capablities */

#define NUM_PLAYERS 2
#include <unistd.h>
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>

#include "Master.h"
#include "Player.h"
#include "DistributedCounter.h"
#include "TwoWayList.cc"

int main(void){

	Master master;
	master.ForkAndSpin(); 

	DistributedCounter dCounter(NUM_PLAYERS);
#if 0
	TwoWayList <EventProcessor> myPlayers;
	for (int i=0; i<NUM_WORKERS; ++i) {
		Worker newWorker(master, dCounter);
		newWorker.ForkAndSpin();
		myWorkers.Insert(newWorker);
	}
#endif
	Player player1(master,dCounter);	
	player1.ForkAndSpin();

	Player player2(master,dCounter);	
	player2.ForkAndSpin();

	master.WaitForProcessorDeath(); 

	return 0;
}
